package com.hlw.hr_man.serviceImpl;

import java.util.List;

import com.hlw.hr_man.Model.Absent;
import com.hlw.hr_man.dao.AbsentDao;
import com.hlw.hr_man.daoImpl.AbsentDaoImpl;
import com.hlw.hr_man.service.AbsentService;

/**
 * 
 * @ClassName: AbsentServiceImpl
 * @Description: 员工缺勤服务实现类
 * @author 唐明
 * @date 2016年9月13日 上午10:47:24
 *
 */
public class AbsentServiceImpl implements AbsentService {

	AbsentDao adao = new AbsentDaoImpl();
	
	@Override
	public List<Absent> getEmployeeByEid(int eid, int start, int pageSize) {
		// TODO Auto-generated method stub
		return adao.selectEmployeeByEid(eid, start, pageSize);
	}

	@Override
	public int getEmployeeAbsent(int eid) {
		// TODO Auto-generated method stub
		return adao.selectEmployeeAbsent(eid);
	}

	@Override
	public List<Absent> getEmployeeAbsentBySearch(String searchType, String searchContent, int start, int pageSize) {
		// TODO Auto-generated method stub
		return adao.selectEmployeeAbsentBySearch(searchType, searchContent, start, pageSize);
	}

	@Override
	public int getEmployeeAbsentCount(String searchType, String searchContent) {
		// TODO Auto-generated method stub
		return adao.selectEmployeeAbsentCount(searchType, searchContent);
	}

	@Override
	public boolean addAbsent(Absent absent) {
		// TODO Auto-generated method stub
		if (adao.insertAbsent(absent) == 1) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public boolean deleteAbsentByEid(int e_id) {
		// TODO Auto-generated method stub
		if (adao.deleteAbsentByEid(e_id)>=0) {
			return true;
		} else {
			return false;
		}
	}

}
